<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <!-- import CSS -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- import Vue before Element -->
    <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
    <!-- import JavaScript -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
    获取IP：<a href="/commService/userIp.do">/commService/userIp.do </a>
    <br>
    获取浏览器信息：<a href="/commService/userAgent.do">/commService/userAgent.do </a>
    <br>
    获取Cookie信息：<a href="/commService/cookies.do">/commService/cookies.do </a>
    <br>
    获取接口访问数：<a href="/commService/uriViews.do">/commService/uriViews.do </a>
    <br>
    点击下载文件：<a @click="getFile()" href="javascript:void(0);">/fileService/down.do</a>
    <br>
    <span @click="download()">{{fileAddress}}</span>
</div>
</body>

<script>
    new Vue({
        el: '#app',
        data: function() {
            return {
                userName:undefined,
                password:undefined,
                fileAddress:undefined
            }
        },
        methods:{
            getFile(){
                axios({
                    method:"get",
                    url:"http://47.113.184.61:8080/commService/fileService/down.do",
                    params:{
                        fileUrl: 'http://175.178.1.73:8888/down/3gHGy3gFziIp'
                    }
                }).then((resp) => {
                    if(resp.status === 200) {
                       this.fileAddress = "文件地址"
                    }
                }).catch((err) => {
                    console.log(err);
                })
            },
            download(){
                window.location.href="../../file.txt";
            }
        }
    })
</script>
</html>